package com.mingzhi.blog.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mingzhi.blog.utils.DateUtils;
import lombok.Data;

import java.util.Date;
@Data
public class BlogInfo {
    private Integer id;
    private String title;
    private String content;
    private Integer userId;
    private Integer deleteFlag;
    private Date createTime;
    //也可以使用注解
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

    //重写get方法
    public String getUpdateTime() {
        return DateUtils.format(updateTime);
    }
}
